import React from 'react';
import { FlatList, View, Text } from 'react-native';
import PlanItem from './PlanItem';

/**
 * 计划列表组件
 * TODO: 实现完整的列表功能
 */
const PlanList = ({ plans, onPlanPress, onPlanToggle, onPlanDelete }) => {
  return (
    <FlatList
      data={plans}
      keyExtractor={(item) => item.id}
      renderItem={({ item }) => (
        <PlanItem
          plan={item}
          onPress={() => onPlanPress?.(item)}
          onToggle={() => onPlanToggle?.(item.id)}
          onDelete={() => onPlanDelete?.(item.id)}
        />
      )}
      ListEmptyComponent={
        <View style={{ padding: 20, alignItems: 'center' }}>
          <Text style={{ color: '#8E8E93' }}>暂无计划</Text>
        </View>
      }
    />
  );
};

export default PlanList;

